package object;
import java.util.Scanner;

class Helicopter {
    public void takeOff() {
        System.out.println("飞机起飞");
    }

    public void Land() {
        System.out.println("飞机降落");
    }

    public void inNormalFlight() {
        System.out.println("正常飞行");
    }
}

class Warcraft {
    int ammo = 0;

    public void setAmmo(int num) {
        ammo = num;
        System.out.println("现已装载弹药数量：" + num);
    }

    public void Emmit(int num) {
        if (ammo < num)
            System.out.println("没有充足的弹药");
        else
            System.out.println(num + "颗弹药发射"+" 剩余弹药：" + (ammo - num));
    }
}

class Passenger {
    public void board() {
        System.out.println("上机");
    }

    public void deplane() {
        System.out.println("下机");
    }
}

class Plane {
    Passenger person = new Passenger();
}

class Airpot {
    Helicopter h = new Helicopter();
    Plane p = new Plane();
    Warcraft w = new Warcraft();
}

public class Main {
    public static void main(String[] args) {
        System.out.println("请选择飞机类型：");
        System.out.println("1.直升机 2.客机 3.战斗机");
		Scanner sc = new Scanner(System.in);
        int nextInt = sc.nextInt();
        switch(nextInt) {
            case 1: 
                System.out.println("直升机具有的功能：");
                Helicopter h = new Helicopter();
                h.takeOff();
                h.Land();
                break;
            case 2:
                System.out.println("客机上的乘客可以：");
                Plane p = new Plane();
                p.person.board();
                p.person.deplane();
                break;
            case 3:
                System.out.println("请配置炮弹数：");
                sc = new Scanner(System.in);
                nextInt = sc.nextInt();
                Warcraft w = new Warcraft();
                w.setAmmo(nextInt);
                System.out.println("请选择发射的炮弹数：");
                sc = new Scanner(System.in);
                nextInt = sc.nextInt();
                w.Emmit(nextInt);
                break;
        }
    }
}